Left Termination of the query pattern goal_in_1(g) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

list([]).
list(.(X, XS)) :- list(XS).
s2l(s(X), .(Y, Xs)) :- s2l(X, Xs).
s2l(0, []).
goal(X) :- ','(s2l(X, XS), list(XS)).

Queries:

goal(g).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

goal_in(X) → U3(X, s2l_in(X, XS))
s2l_in(0, []) → s2l_out(0, [])
s2l_in(s(X), .(Y, Xs)) → U2(X, Y, Xs, s2l_in(X, Xs))
U2(X, Y, Xs, s2l_out(X, Xs)) → s2l_out(s(X), .(Y, Xs))
U3(X, s2l_out(X, XS)) → U4(X, list_in(XS))
list_in(.(X, XS)) → U1(X, XS, list_in(XS))
list_in([]) → list_out([])
U1(X, XS, list_out(XS)) → list_out(.(X, XS))
U4(X, list_out(XS)) → goal_out(X)

The argument filtering Pi contains the following mapping:
goal_in(x1)  =  goal_in(x1)
U3(x1, x2)  =  U3(x2)
s2l_in(x1, x2)  =  s2l_in(x1)
0  =  0
[]  =  []
s2l_out(x1, x2)  =  s2l_out(x2)
s(x1)  =  s(x1)
.(x1, x2)  =  .(x2)
U2(x1, x2, x3, x4)  =  U2(x4)
U4(x1, x2)  =  U4(x2)
list_in(x1)  =  list_in(x1)
U1(x1, x2, x3)  =  U1(x3)
list_out(x1)  =  list_out
goal_out(x1)  =  goal_out

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

goal_in(X) → U3(X, s2l_in(X, XS))
s2l_in(0, []) → s2l_out(0, [])
s2l_in(s(X), .(Y, Xs)) → U2(X, Y, Xs, s2l_in(X, Xs))
U2(X, Y, Xs, s2l_out(X, Xs)) → s2l_out(s(X), .(Y, Xs))
U3(X, s2l_out(X, XS)) → U4(X, list_in(XS))
list_in(.(X, XS)) → U1(X, XS, list_in(XS))
list_in([]) → list_out([])
U1(X, XS, list_out(XS)) → list_out(.(X, XS))
U4(X, list_out(XS)) → goal_out(X)

The argument filtering Pi contains the following mapping:
goal_in(x1)  =  goal_in(x1)
U3(x1, x2)  =  U3(x2)
s2l_in(x1, x2)  =  s2l_in(x1)
0  =  0
[]  =  []
s2l_out(x1, x2)  =  s2l_out(x2)
s(x1)  =  s(x1)
.(x1, x2)  =  .(x2)
U2(x1, x2, x3, x4)  =  U2(x4)
U4(x1, x2)  =  U4(x2)
list_in(x1)  =  list_in(x1)
U1(x1, x2, x3)  =  U1(x3)
list_out(x1)  =  list_out
goal_out(x1)  =  goal_out


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

GOAL_IN(X) → U31(X, s2l_in(X, XS))
GOAL_IN(X) → S2L_IN(X, XS)
S2L_IN(s(X), .(Y, Xs)) → U21(X, Y, Xs, s2l_in(X, Xs))
S2L_IN(s(X), .(Y, Xs)) → S2L_IN(X, Xs)
U31(X, s2l_out(X, XS)) → U41(X, list_in(XS))
U31(X, s2l_out(X, XS)) → LIST_IN(XS)
LIST_IN(.(X, XS)) → U11(X, XS, list_in(XS))
LIST_IN(.(X, XS)) → LIST_IN(XS)

The TRS R consists of the following rules:

goal_in(X) → U3(X, s2l_in(X, XS))
s2l_in(0, []) → s2l_out(0, [])
s2l_in(s(X), .(Y, Xs)) → U2(X, Y, Xs, s2l_in(X, Xs))
U2(X, Y, Xs, s2l_out(X, Xs)) → s2l_out(s(X), .(Y, Xs))
U3(X, s2l_out(X, XS)) → U4(X, list_in(XS))
list_in(.(X, XS)) → U1(X, XS, list_in(XS))
list_in([]) → list_out([])
U1(X, XS, list_out(XS)) → list_out(.(X, XS))
U4(X, list_out(XS)) → goal_out(X)

The argument filtering Pi contains the following mapping:
goal_in(x1)  =  goal_in(x1)
U3(x1, x2)  =  U3(x2)
s2l_in(x1, x2)  =  s2l_in(x1)
0  =  0
[]  =  []
s2l_out(x1, x2)  =  s2l_out(x2)
s(x1)  =  s(x1)
.(x1, x2)  =  .(x2)
U2(x1, x2, x3, x4)  =  U2(x4)
U4(x1, x2)  =  U4(x2)
list_in(x1)  =  list_in(x1)
U1(x1, x2, x3)  =  U1(x3)
list_out(x1)  =  list_out
goal_out(x1)  =  goal_out
S2L_IN(x1, x2)  =  S2L_IN(x1)
U41(x1, x2)  =  U41(x2)
U21(x1, x2, x3, x4)  =  U21(x4)
U31(x1, x2)  =  U31(x2)
LIST_IN(x1)  =  LIST_IN(x1)
GOAL_IN(x1)  =  GOAL_IN(x1)
U11(x1, x2, x3)  =  U11(x3)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

GOAL_IN(X) → U31(X, s2l_in(X, XS))
GOAL_IN(X) → S2L_IN(X, XS)
S2L_IN(s(X), .(Y, Xs)) → U21(X, Y, Xs, s2l_in(X, Xs))
S2L_IN(s(X), .(Y, Xs)) → S2L_IN(X, Xs)
U31(X, s2l_out(X, XS)) → U41(X, list_in(XS))
U31(X, s2l_out(X, XS)) → LIST_IN(XS)
LIST_IN(.(X, XS)) → U11(X, XS, list_in(XS))
LIST_IN(.(X, XS)) → LIST_IN(XS)

The TRS R consists of the following rules:

goal_in(X) → U3(X, s2l_in(X, XS))
s2l_in(0, []) → s2l_out(0, [])
s2l_in(s(X), .(Y, Xs)) → U2(X, Y, Xs, s2l_in(X, Xs))
U2(X, Y, Xs, s2l_out(X, Xs)) → s2l_out(s(X), .(Y, Xs))
U3(X, s2l_out(X, XS)) → U4(X, list_in(XS))
list_in(.(X, XS)) → U1(X, XS, list_in(XS))
list_in([]) → list_out([])
U1(X, XS, list_out(XS)) → list_out(.(X, XS))
U4(X, list_out(XS)) → goal_out(X)

The argument filtering Pi contains the following mapping:
goal_in(x1)  =  goal_in(x1)
U3(x1, x2)  =  U3(x2)
s2l_in(x1, x2)  =  s2l_in(x1)
0  =  0
[]  =  []
s2l_out(x1, x2)  =  s2l_out(x2)
s(x1)  =  s(x1)
.(x1, x2)  =  .(x2)
U2(x1, x2, x3, x4)  =  U2(x4)
U4(x1, x2)  =  U4(x2)
list_in(x1)  =  list_in(x1)
U1(x1, x2, x3)  =  U1(x3)
list_out(x1)  =  list_out
goal_out(x1)  =  goal_out
S2L_IN(x1, x2)  =  S2L_IN(x1)
U41(x1, x2)  =  U41(x2)
U21(x1, x2, x3, x4)  =  U21(x4)
U31(x1, x2)  =  U31(x2)
LIST_IN(x1)  =  LIST_IN(x1)
GOAL_IN(x1)  =  GOAL_IN(x1)
U11(x1, x2, x3)  =  U11(x3)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 6 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LIST_IN(.(X, XS)) → LIST_IN(XS)

The TRS R consists of the following rules:

goal_in(X) → U3(X, s2l_in(X, XS))
s2l_in(0, []) → s2l_out(0, [])
s2l_in(s(X), .(Y, Xs)) → U2(X, Y, Xs, s2l_in(X, Xs))
U2(X, Y, Xs, s2l_out(X, Xs)) → s2l_out(s(X), .(Y, Xs))
U3(X, s2l_out(X, XS)) → U4(X, list_in(XS))
list_in(.(X, XS)) → U1(X, XS, list_in(XS))
list_in([]) → list_out([])
U1(X, XS, list_out(XS)) → list_out(.(X, XS))
U4(X, list_out(XS)) → goal_out(X)

The argument filtering Pi contains the following mapping:
goal_in(x1)  =  goal_in(x1)
U3(x1, x2)  =  U3(x2)
s2l_in(x1, x2)  =  s2l_in(x1)
0  =  0
[]  =  []
s2l_out(x1, x2)  =  s2l_out(x2)
s(x1)  =  s(x1)
.(x1, x2)  =  .(x2)
U2(x1, x2, x3, x4)  =  U2(x4)
U4(x1, x2)  =  U4(x2)
list_in(x1)  =  list_in(x1)
U1(x1, x2, x3)  =  U1(x3)
list_out(x1)  =  list_out
goal_out(x1)  =  goal_out
LIST_IN(x1)  =  LIST_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LIST_IN(.(X, XS)) → LIST_IN(XS)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x2)
LIST_IN(x1)  =  LIST_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

LIST_IN(.(XS)) → LIST_IN(XS)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

S2L_IN(s(X), .(Y, Xs)) → S2L_IN(X, Xs)

The TRS R consists of the following rules:

goal_in(X) → U3(X, s2l_in(X, XS))
s2l_in(0, []) → s2l_out(0, [])
s2l_in(s(X), .(Y, Xs)) → U2(X, Y, Xs, s2l_in(X, Xs))
U2(X, Y, Xs, s2l_out(X, Xs)) → s2l_out(s(X), .(Y, Xs))
U3(X, s2l_out(X, XS)) → U4(X, list_in(XS))
list_in(.(X, XS)) → U1(X, XS, list_in(XS))
list_in([]) → list_out([])
U1(X, XS, list_out(XS)) → list_out(.(X, XS))
U4(X, list_out(XS)) → goal_out(X)

The argument filtering Pi contains the following mapping:
goal_in(x1)  =  goal_in(x1)
U3(x1, x2)  =  U3(x2)
s2l_in(x1, x2)  =  s2l_in(x1)
0  =  0
[]  =  []
s2l_out(x1, x2)  =  s2l_out(x2)
s(x1)  =  s(x1)
.(x1, x2)  =  .(x2)
U2(x1, x2, x3, x4)  =  U2(x4)
U4(x1, x2)  =  U4(x2)
list_in(x1)  =  list_in(x1)
U1(x1, x2, x3)  =  U1(x3)
list_out(x1)  =  list_out
goal_out(x1)  =  goal_out
S2L_IN(x1, x2)  =  S2L_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

S2L_IN(s(X), .(Y, Xs)) → S2L_IN(X, Xs)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
.(x1, x2)  =  .(x2)
S2L_IN(x1, x2)  =  S2L_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

S2L_IN(s(X)) → S2L_IN(X)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: